<template>
    <div class="editDemand">
        <el-form :model="demandInfo" :rules="rules" label-width="80px" class="demo-ruleForm" size="small">
            <el-col :span="8">
                <el-form-item label="项目编号" prop="id">
                    <el-input readonly placeholder="系统自动分配"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="项目名称" prop="name">
                    <el-input v-model="demandInfo.name" placeholder="请输入项目名称"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="投资金额" prop="amount">
                    <el-input v-model="demandInfo.amount" placeholder="请输入投资金额（万）"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="投资方式" prop="type">
                    <el-select  v-model="demandInfo.type" placeholder="请选择投资方式">
                        <el-option v-for="it in depts" :key="it" :label='it' :value="it"></el-option>
                    </el-select>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="项目等级" prop="level">
                    <el-input v-model="demandInfo.level" placeholder="请输入项目等级"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="项目工期" prop="schedule">
                    <el-input v-model="demandInfo.schedule" placeholder="请输入项目工期（月）"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="提交部门" prop="unit">
                    <el-select  v-model="demandInfo.unit" placeholder="请选择提交的部门">
                        <el-option v-for="it in depts" :key="it" :label='it' :value="it"></el-option>
                    </el-select>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="联系人" prop="contact">
                    <el-input v-model="demandInfo.contact" placeholder="默认填写人"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="联系手机" prop="phone">
                    <el-input v-model="demandInfo.phone" placeholder="请输入联系方式"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="附件" prop="fileName">
                    <el-input v-model="demandInfo.fileName" placeholder="请上传附件"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="提交日期" prop="time">
                    <el-date-picker value-format="yyyy-MM-dd" type="date" placeholder="选择日期" v-model="demandInfo.time" ></el-date-picker>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="审核人" prop="handler">
                    <el-input v-model="demandInfo.handler" placeholder="请添加审核人"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="24">
                <el-form-item label="项目备注" prop="remark">
                    <el-input v-model="demandInfo.remark" type="textarea" placeholder="项目进度，提交原因……"></el-input>
                </el-form-item>
            </el-col>
        
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="cancelEvt" size="small">取 消</el-button>
            <el-button type="primary" @click="addUserEvt" size="small">确 定</el-button>
        </div>
    </div>
</template>

<script>
    export default {
        data () {
            return {
                demandInfo : {
                    id : '',
                    name : '',
                    amount : '',
                    type : '',
                    level : '',
                    schedule : '',
                    unit : '',
                    contact : '',
                    phone : '',
                    fileName : '',
                    time : '',
                    handler : '',
                    remark : '',
                },
                rules : {}
           }
       },
       methods : {
           cancelEvt () {
               this.$router.push('/demand/list')
           }
       }
    }
</script>

<style lang="less" scoped>
   .dialog-footer {
       text-align: right;
   }
</style>

